
import java.util.Scanner;

// 雇员类
class Employee {
    // 计算工资的方法，在子类中重写
    public int getSalary() {
        return 0;
    }
}

// 经理类，继承自雇员类
class Manager extends Employee {
    private int monthlySalary;

    public Manager(int monthlySalary) {
        this.monthlySalary = monthlySalary;
    }

    @Override
    public int getSalary() {
        return monthlySalary;
    }
}

// 销售人员类，继承自雇员类
class Salesman extends Employee {
    private int baseSalary;
    private double salesAmount;

    public Salesman(int baseSalary, double salesAmount) {
        this.baseSalary = baseSalary;
        this.salesAmount = salesAmount;
    }

    @Override
    public int getSalary() {
        return baseSalary + (int) (salesAmount * 0.3);
    }
}

// 工人类，继承自雇员类
class Worker extends Employee {
    private int workingDays;
    private int dailySalary = 120;

    public Worker(int workingDays) {
        this.workingDays = workingDays;
    }

    @Override
    public int getSalary() {
        return workingDays * dailySalary;
    }
}

public class Test31 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        // 输入经理的月工资
        int managerSalary = scanner.nextInt();
        Employee manager = new Manager(managerSalary);

        // 输入销售人员的基本工资和提成
        int salesmanBaseSalary = scanner.nextInt();
        double salesmanSalesAmount = scanner.nextDouble();
        Employee salesman = new Salesman(salesmanBaseSalary, salesmanSalesAmount);

        // 输入工人的工作天数
        int workerWorkingDays = scanner.nextInt();
        Employee worker = new Worker(workerWorkingDays);

        // 输出工资
        System.out.println(manager.getSalary());
        System.out.println(salesman.getSalary());
        System.out.println(worker.getSalary());

        scanner.close();
    }
}